package com.pmdb.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class MovieDetail extends Composite {
   private FlexTable flexTable = new FlexTable();
   private TextBox titleTxtBox = new TextBox();
   private TextBox yearTxtBox = new TextBox();
   private TextBox directorTxtBox = new TextBox();


   public MovieDetail() {
      flexTable.setWidth("32em");
      //flexTable.setCellSpacing(5);
      //flexTable.setCellPadding(3);
      
      titleTxtBox.setWidth("270");
      yearTxtBox.setMaxLength(4);
      yearTxtBox.setWidth("50px");
      yearTxtBox.setTextAlignment(TextBox.ALIGN_CENTER);

      VerticalPanel titlePanel = new VerticalPanel();
      titlePanel.add(new HTML("Original title :"));
      titlePanel.add(titleTxtBox);
      flexTable.setWidget(0, 0, titlePanel);

      VerticalPanel yearPanel = new VerticalPanel();
      yearPanel.add(new HTML("Year :"));
      yearPanel.add(yearTxtBox);
      flexTable.setWidget(1, 0, yearPanel);

      VerticalPanel directorPanel = new VerticalPanel();
      yearPanel.add(new HTML("Director :"));
      yearPanel.add(directorTxtBox);
      flexTable.setWidget(2, 0, directorPanel);

      initWidget(flexTable);
      setStyleName("movie-Detail");
      //headerPanel.setStyleName("movie-DetailHeader");
      //innerPanel.setStyleName("movie-DetailInner");
      //subject.setStyleName("movie-DetailSubject");
      //sender.setStyleName("movie-DetailSender");
      //recipient.setStyleName("movie-DetailRecipient");
      //body.setStyleName("movie-DetailBody");
   }


   public void setItem(MovieItem item) {
      titleTxtBox.setText(item.getOriginalTitle());
      yearTxtBox.setText(item.getYear());
      directorTxtBox.setText(item.getDirector());
      
      
   }
}
